# gid58425 = 0
# gid58700 = 1
# gid58467 = 2
# gid58525 = 3
# gid58397 = 4
# gid58385 = 5
# gid58676 = 6
# gid5837 = 7
# gid58595 = 8
# gid5861 = 9
def change(word):
    word_data = {
        58425: '0', 58700: '1', 58467: '2', 58525: '3',
        58397: '4', 58385: '5', 58676: '6', 58347: '7',
        58595: '8', 58461: '9'
    }
    return ''.join(word_data.get(ord(c), c) for c in word)


import requests
# from curl_cffi import requests
headers = {
    'Cookie':'ttwid=1%7Cg8mi9X6wjuduZ4KcshiA7KxQPsyUDBhcDBucr-K4lHA%7C1761910891%7Ca903d966f55cb3534417f3bef32096a73b66529573233a942f17341e51c8b83a; tt_webid=7567349597893002776; tt_web_version=new; is_dev=false; is_boe=false; Hm_lvt_3e79ab9e4da287b5752d8048743b95e6=1761910892; HMACCOUNT=13BAD7746936B6C2; x-web-secsdk-uid=ad374caf-2a3d-461e-b06b-1869862a4c34; s_v_web_id=verify_mhes95c7_L5NxuJvU_TBsm_4fDE_9XCb_lo7PJYfRphWB; city_name=%E9%83%91%E5%B7%9E; _gid=GA1.2.1394805030.1761911247; rit_city=%E9%83%91%E5%B7%9E; Hm_lpvt_3e79ab9e4da287b5752d8048743b95e6=1761911341; _ga=GA1.1.54934247.1761910892; _ga_YB3EWSDTGF=GS2.1.s1761910892$o1$g1$t1761912001$j60$l0$h0',
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36',
}

# url = 'https://www.dongchedi.com/usedcar/x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x'
url = 'https://www.dongchedi.com/motor/pc/sh/sh_sku_list?aid=1839&app_name=auto_web_pc&sh_city_name=%E9%83%91%E5%B7%9E'

data = {
    'sh_city_name':'郑州',
    'page':'3',
    'limit':'60',
}
# post请求需要在载荷中找参数
response = requests.post(
    url=url,
    headers=headers,
    data=data,

)
# print(response.status_code)

json_data = response.json()
info_list = json_data['data']['search_sh_sku_info_list']
# print(info_list)
for info in info_list:
    dit = {
        '品牌':info['brand_name'],
        '品牌来源城市':info['brand_source_city_name'],
        '指导价':change(info['official_price']),
        '价格':change(info['sh_price']),
    }


    print(dit)
    # break


